﻿<local:DocumentBase x:Class="WPFExcelReport.YGREKDOC"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    FontSize="16"
                    Loaded="Window_Loaded"
                    Background="White" 
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <CollectionViewSource   x:Key="vwLIEFDAT" Source="{Binding Path=LIEFDAT,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwEKKOPF" Source="{Binding Path=EKKOPF,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwMaster" Source="{Binding Path=ICC_EKPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWASTAMM" Source="{Binding Path=WASTAMM,Source={StaticResource SetData}}" />
             
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="1*" ></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Expander  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
            Name="expLog" ExpandDirection="Down" IsExpanded="True">
            <StackPanel>
                <WrapPanel Name="zoneCommand" Margin="4,0,51,6" Grid.ColumnSpan="3">
                    <Label Content="系统" Width="Auto" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0" Text="00" HorizontalAlignment="Left" Background="Pink"  TabIndex="1" />
                    <Label Content="语言" Width="Auto" Margin="0,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                    <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                    <Label Content="用户名" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                    <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                    <Label Content="密码" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                    <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow"  KeyboardNavigation.TabIndex="1" TabIndex="4" />
                    <Button Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="Auto" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">
                        登录
                    </Button>
                    <TextBlock Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="14" KeyboardNavigation.TabIndex="1" />
                </WrapPanel>
            </StackPanel>
        </Expander>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel Name="ZoneOrder">
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="客户号:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" 
                                                                 Text="{Binding Path=VKKKUNDNR, Source={StaticResource ResourceKey=vwEKKOPF}}" VerticalAlignment="Center" Width="80" />
                </Grid>
                <TextBlock Width="Auto">采购单:</TextBlock>
                <TextBox   Name="txtAUFKRS" MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper" TabIndex="11" />
                <TextBox   Name="txtAUFLFD" MaxLength="6" Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" KeyUp="txtAUFLFD_KeyUp" />
                <TextBox   Name="txtAUFPOS" MaxLength="6" Width="40" Margin="0,0,0,0"  HorizontalAlignment="Left" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBlock FontSize="18"    Width="59" Name="txt1" Margin="0,0,0,0" Text="采购单" />
                <ComboBox Visibility="Collapsed"  ItemsSource="{Binding Source={StaticResource ResourceKey=vwLIEFDAT}}"
                            Margin="20,0,0,0"
                       Background="Gray"  MinWidth="100" 
                       DisplayMemberPath="LSLIEFNA"
                       IsEditable="True"
                       SelectedValuePath="LSLIEFNR"
                       >
                </ComboBox>
                <Button FontSize="18" Content="查询"  BorderBrush="Yellow" Margin="20,0,0,0"   Click="btnQuery_Click" ></Button>
                <Button Content="打印"  FontSize="18"   BorderBrush="Yellow" Margin="20,0,0,0"   Width="Auto" Click="btnPrint_Click"/>
            </WrapPanel>
            <WrapPanel>
                <DataGrid CanUserReorderColumns="True"   
                          Height="300"
                          FontSize="12"
                  CanUserResizeRows="True" CanUserSortColumns="True"                  
                  AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  x:Name="dlgMaster" 
                  Margin="0,1,0,0" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="" Binding="{Binding EKPAUFKRS}" Width="Auto"/>
                        <DataGridTextColumn Header="采购单" Binding="{Binding EKPAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                        <DataGridTextColumn Header="" Binding="{Binding EKPAUFPOS}" Width="Auto"/>
                        <DataGridTextColumn Header="纱线" Binding="{Binding EKPART}" Width="Auto"/>
                        <DataGridTextColumn Header="色号" Binding="{Binding EKPFARBE}" Width="Auto"/>
                        <DataGridTextColumn Header="数量" Binding="{Binding Path=EKPME1, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="交期" Binding="{Binding EKPLTERM}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
            </WrapPanel>
        </StackPanel>
        <TabControl Grid.Row="2" Grid.Column="0" >
            <TabItem Header="供应商订单">
                <DataGrid CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwEKKOPF}}" 
                              Margin="0,1,0,0" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="" Binding="{Binding EKKAUFKRS}" Width="40"/>
                        <DataGridTextColumn Header="采购单" Binding="{Binding EKKAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
            </TabItem>
        </TabControl>
        
        
    </Grid>
</local:DocumentBase>
